/**
 * 
 */
package com.storm.lib.base;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.storm.lib.bean.ValueBean;
import com.storm.lib.util.StringUtil;



/**
 * 类功能: 参数基类
 * @author johnny
 * @version 2010-11-25
 */
public class BaseParameter implements Serializable{
	private List<ValueBean> params = new ArrayList<ValueBean>();
	private Integer paramType;
	/**
	 * @return the params
	 */
	public List<ValueBean> getParams() {
		return params;
	}
	/**
	 * @param params the params to set
	 */
	public void setParams(List<ValueBean> params) {
		this.params = params;
	}
	/**
	 * @return the paramType
	 */
	public Integer getParamType() {
		return paramType;
	}
	/**
	 * @param paramType the paramType to set
	 */
	public void setParamType(Integer paramType) {
		this.paramType = paramType;
	}
	
	public void addValueBean(ValueBean valueBean){
		this.getParams().add(valueBean);
	}

	public String toString() {
		StringBuffer value = new StringBuffer();
		value.append(getParamType()+"@");
		String[] valueBeans = new String[getParams().size()];
		for (int i = 0; i < valueBeans.length; i++) {
			valueBeans[i] =  getParams().get(i).toExp();
		}
		value.append(StringUtil.implode(valueBeans, ","));
		return value.toString();
	}
	
	
	
}
